package movie.test.people;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import movie.test.as.people.service.MoviePeopleService;
import movie.test.movie.MovieInfoController;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONObject;


@RestController
@RequestMapping("/peopleController")
public class PeopleController {
	
	private static Logger logger = LoggerFactory.getLogger(PeopleController.class);
	@Autowired
	private MoviePeopleService moviePeopleServiceImpl;
	
	/**
	 * 查询演员信息
	 * @param objs
	 * @param request
	 * @return
	 */
	@ResponseBody
	@RequestMapping("/getPeopelInfo")
	Map<String,Object> getPeopelInfo(@RequestBody JSONObject objs,HttpServletRequest request){
		try {
			logger.debug("开始演员信息---");
			List<Map<String, Object>> pageResult =  moviePeopleServiceImpl.getPeopelInfo(objs);
			logger.info("查询演员信息结束---");
			LinkedHashMap<String, Object> linkedHashMap = new LinkedHashMap<String, Object>();
			linkedHashMap.put("result", pageResult);
			return linkedHashMap;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
}
